import { DefendSkillPropListPanel } from "../defend/DefendSkillPropListPanel";
import { Lv88ProgressBar } from "./Lv88ProgressBar";
import { ImagesConst } from "../../../resource/ImagesConst";
import { ItemData } from "../../../resource/info/ItemData";
import { SAttribute } from "../../../../../Message/Public/SAttribute";
import { FilterConst } from "../../../../component/gconst/FilterConst";
import { ShortcutsItem } from "../../shortcuts/ShortcutsItem";
import { MsgManager } from "../../../manager/MsgManager";
import { Language } from "../../../../../extend/language/Language";
import { GameProxy } from "../../../mvc/GameProxy";
type int = number;
//class Lv88SkillPanel
    
    export  class Lv88SkillPanel extends DefendSkillPropListPanel
    {
        constructor(arg1: int=5, arg2: Boolean=false, arg3: string="", arg4: string="", arg5: Boolean=false)
        {
            super(arg1, arg2, arg3, arg4, arg5);
            return;
        }

        protected /* override */ createChildren(): void
        {
            super.createChildren();
            this._fireBar = new Lv88ProgressBar(ImagesConst.LV88_FireProccessBg, ImagesConst.LV88_FireProccess, 52, 18, 180);
            this._fireBar.x = 0;
            this._fireBar.y = -45;
            this._fireBar.setValue(0, 100);
            this.addChild(this._fireBar);
            return;
        }

        public /* override */ setPropListData(arg1: Array<any>): void
        {
            var loc1=0;
            _propList = arg1;
            loc1 = 0;
            while (loc1 < _skillMaxNum) 
            {
                if (loc1 < arg1.length) 
                {
                    _propVec[loc1].dragSource = new ItemData(arg1[loc1]);
                    if (!_needShowNum) 
                    {
                        _propVec[loc1].setAmountText(-1);
                    }
                    _propVec[loc1].doCoolDown(_cd);
                }
                else 
                {
                    _propVec[loc1].dragSource = null;
                }
                ++loc1;
            }
            return;
        }

        public updateFire(arg1: SAttribute): void
        {
            if (this._fireBar == null) 
            {
                return;
            }
            this._fireBar.updateFire(arg1);
            this.enableSkill(this._fireBar.curFireNum >= 1);
            return;
        }

        public enableSkill(arg1: Boolean): void
        {
            var loc2=null;
            var loc1=0;
            while (loc1 < _propVec.length) 
            {
                loc2 = _propVec[loc1];
                if (arg1) 
                {
                    loc2.filters = [];
                }
                else 
                {
                    loc2.filters = [FilterConst.colorFilter];
                }
                ++loc1;
            }
            return;
        }

        protected /* override */ onItemClick(arg1: Object /* flash.events.MouseEvent */): void
        {
            if (this._fireBar.curFireNum < 1) 
            {
                return;
            }
            var loc1=arg1.target as ShortcutsItem;
            if (loc1.playingEffect) 
            {
                MsgManager.showRollTipsMsg(Language.getString(60054));
            }
            else if (loc1.dragSource) 
            {
                if (loc1.itemData) 
                {
                    GameProxy.copy.lv88CopyOperation(loc1.itemData.itemCode);
                }
                startPropCd();
            }
            return;
        }

        /* internal */ /* var */_fireBar: Lv88ProgressBar;
    }
